package cn.wolfcode.p2p.business.service.impl;

import cn.wolfcode.p2p.base.query.QueryObject;
import cn.wolfcode.p2p.business.domain.PlatformBankInfo;
import cn.wolfcode.p2p.business.domain.RechargeOffline;
import cn.wolfcode.p2p.business.mapper.PlatformBankInfoMapper;
import cn.wolfcode.p2p.business.service.IPlatformBankInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class PlatformBankInfoServiceImpl implements IPlatformBankInfoService {

    @Autowired
    private PlatformBankInfoMapper bankInfoMapper;



    @Override
    public PageInfo listForPage(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        List list = bankInfoMapper.selectForPage(qo);
        return new PageInfo(list);
    }

    @Override
    public void update(PlatformBankInfo bankInfo) {
        bankInfoMapper.updateByPrimaryKey(bankInfo);
    }

    @Override
    public void save(PlatformBankInfo bankInfo) {
        bankInfoMapper.insert(bankInfo);
    }

    @Override
    public List listAll() {
        return bankInfoMapper.selectAll();
    }


}
